// pages/my/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mylist:{},
    task:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    this.getmy()
    this.gettask()
  },
  // 渲染头像手机号
  async getmy() {
    const {data:mylist} = await wx.http.get('/driver/users')
    this.setData({
      mylist
    })
  },
 async gettask(){
   const data = new Date()
  const {data:task} = await wx.http.get('/driver/users/taskReport',{
    month: data.getMonth()+1,
    year: data.getFullYear()
  })
  this.setData({
      task
  })
  },
  // 车辆信息
  vehicle(){
    wx.navigateTo({
      url: '/my/pages/vehicle/index',
    })
  },
  // 任务数据
  task(){
    wx.navigateTo({
      url: '/my/pages/task/index',
    })
  },
  // 系统设置
  settings(){
    wx.navigateTo({
      url: '/my/pages/settings/index',
    })
  }
})